package com.oracle.daoImpl;

import com.oracle.dao.AccountDao;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

public class AccountDaoImpl extends JdbcDaoSupport implements AccountDao {
    @Override
    public boolean outer(String outer, int money) {
        String sql = "update account set balance = balance - ? where aname = ?";
        int i = super.getJdbcTemplate().update(sql, money, outer);
        return  i >0 ? true:false;
    }

    @Override
    public boolean inter(String inter, int money) {
        String sql = "update account set balance = balance + ? where aname = ?";
        int i = super.getJdbcTemplate().update(sql, money, inter);
        return  i >0 ? true:false;
    }
}
